package core.heuristic;

import core.course.Course;
import core.course.TimeTable;
import core.interfaces.IState;

public class UtilEasy1 extends HeuristicBase 
{

	/**
	 * 
	 */
	private static final long serialVersionUID = -6245377350830798504L;

	@Override
	public Double getValue(IState<TimeTable> examinee)
	{
		double score = 0.0;
		TimeTable timeTable = examinee.getState();
		double collisionFactor = collision(timeTable);
		if (collisionFactor < 0)
		{
			//there are collisions
			score = collisionFactor;
		}
		else
		{
			//no collisions
			for (Course course : timeTable)
			{
				if(isCourseRelevant(timeTable, course))
				{
					int difficulty = course.getWorkload();
					score += (10 - difficulty);					
				}
			}
		}
		return score;
	}
	
	@Override
	public String toString()
	{
		return UtilEasy1.class.getSimpleName();
	}

	

}
